
/**   
 * @Title: AppclicationContext.java 
 * @Package: com.rename.icode.comm 
 * @Description: Administrator版权所有
 * @author Administrator  
 * @date 2015-2-11 下午5:07:00 
 * @version  
 */


package com.rename.icode.comm;

import android.content.Context;

/** 
 * @Description 获取应用上下文
 * @author Administrator
 * @date 2015-2-11 下午5:07:00 
 * @version V1.0
 */

public class ApplicationContext {
	private Context appContext;

    private ApplicationContext(){}

    public void init(Context context){
        if(appContext == null){
            appContext = context;
        }
    }

    private Context getContext(){
        return appContext;
    }

    public static Context get(){
        return getInstance().getContext();
    }

    private static ApplicationContext instance;

    public static ApplicationContext getInstance(){
        return instance == null ?
                (instance = new ApplicationContext()):
                    instance;
    }
}
